package com.retrofit.demo;

import com.retrofit.demo.entity.AssetEntity;
import com.retrofit.demo.entity.JscbEntiy;
import com.retrofit.demo.entity.ProEntity;
import com.retrofit.demo.entity.YdcdEntity;
import com.retrofit.library.entity.Entity;
import com.retrofit.library.entity.ListEntity;

import org.json.JSONObject;

import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.Url;

/**
 * desc:
 * 2018-05-24 11:15
 */
public interface Api {

    @GET
    Call<JscbEntiy> getTranslation(@Url String path);


    //    @GET("{path}?a=fy&f=auto&t=auto&w=hello%20world")
    //    Call<JscbEntiy> getTranslation(@Path("path") String path);

    //    @GET("ajax.php?a=fy&f=auto&t=auto&w=hello%20world")
    //    Call<JscbEntiy> getTranslation();


    @FormUrlEncoded
    @POST
    Call<YdcdEntity> traslation(@Url String path, @Field("i") String targetSentence);


    //    @FormUrlEncoded
    //    @POST("{path}?doctype=json&jsonversion=&type=&keyfrom=&model=&mid=&imei=&vendor=&screen=&ssid=&network=&abtest=")
    //    Call<YdcdEntity> traslation(@Path("path") String path, @Field("i") String targetSentence);

    //    @FormUrlEncoded
    //    @POST("translate?doctype=json&jsonversion=&type=&keyfrom=&model=&mid=&imei=&vendor=&screen=&ssid=&network=&abtest=")
    //    Call<YdcdEntity> traslation(@Field("i") String targetSentence);


    @POST("order/order/myQJSAssets")
    Call<Entity<AssetEntity>> queryAsset(@Header("loginToken") String loginToken,
                                   @Body RequestBody body);

    @POST("order/order/myQJSAssets")
    Call<JSONObject> queryAssetJO(@Header("loginToken") String loginToken,
                                  @Body RequestBody body);


    @POST("pro/product/queryNewProduct")
    Call<ListEntity<ProEntity>> queryNewProList(@Header("loginToken") String loginToken,
                                                @Body RequestBody body);

}
